package diva.pap;

import android.content.Context;
import diva.android_library.rpc.Response;
import diva.lib.net.UrlBuilder;
import diva.pap.model.RequestBase;

public class TraficRequest extends RequestBase<TraficRequest> {

  private final boolean todaySelected;

  public TraficRequest(Context context, boolean todaySelected, Response<TraficRequest> response) {
    super(context, "trafic_overview", response);
    this.todaySelected = todaySelected;
  }

  public CharSequence getChargebacksapproved() {
    return getString("chargebacksapproved");
  }

  public CharSequence getChargebackspaid() {
    return getString("chargebackspaid");
  }

  public CharSequence getChargebackspending() {
    return getString("chargebackspending");
  }

  public CharSequence getClicksraw() {
    return getNumberString("clicksraw");
  }

  public CharSequence getClicksunique() {
    return getNumberString("clicksunique");
  }

  public CharSequence getCommisionsapproved() {
    return getString("commisionsapproved");
  }

  public CharSequence getCommisionspaid() {
    return getString("commisionspaid");
  }

  public CharSequence getCommisionspending() {
    return getString("commisionspending");
  }

  public CharSequence getImpressionsraw() {
    return getNumberString("impressionsraw");
  }

  public CharSequence getImpressionsunique() {
    return getNumberString("impressionsunique");
  }

  public CharSequence getRefundsapproved() {
    return getString("refundsapproved");
  }

  public CharSequence getRefundspaid() {
    return getString("refundspaid");
  }

  public CharSequence getRefundspending() {
    return getString("refundspending");
  }

  public CharSequence getSalesapproved() {
    return getNumberString("salesapproved");
  }

  public CharSequence getSalescostapproved() {
    return getString("salescostapproved");
  }

  public CharSequence getSalescostpaid() {
    return getString("salescostpaid");
  }

  public CharSequence getSalescostpending() {
    return getString("salescostpending");
  }

  public CharSequence getSalespaid() {
    return getNumberString("salespaid");
  }

  public CharSequence getSalespending() {
    return getNumberString("salespending");
  }

  @Override
  public UrlBuilder getUrl() {
    if (todaySelected)
      return super.getUrl().add("period", "today");
    else return super.getUrl().add("period", "thismonth");
  }
}
